package com.example.moilapp.global;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;

import android.util.Log;

public class Moil_Array_To_List {

	private static HashMap<String, List<String>> DataHash;
	
	private Moil_Array_To_List(){
		DataHash = new HashMap<String, List<String>>();
	}

	public static synchronized HashMap<String, List<String>> getDataHash() {
		return DataHash;
	}
	
	public static synchronized void addToDataHash(String key,String[] StringArr) {
		
		//Log.e("StringArr[0]", StringArr[0]);
		Log.e("key", key);
		
		DataHash.put(key, Arrays.asList(StringArr));
	}

	public static synchronized String[] getDataHashItem(String key) {
		
		Log.e("DataHash", ""+DataHash.size());
		
		if(DataHash.size()==0){
			return new String[0];
		}else{
			return DataHash.get(key).toArray(new String[DataHash.get(key).size()]);
		}

	}
	public static synchronized void reSet(){
		DataHash = new HashMap<String, List<String>>();
	}
}
